<?php
include_once("../common.php");

if(!isVisitor() && isset($_GET['id'])){
	$c = connect();
	$r = mysql_query("SELECT * FROM articles WHERE idarticles ='".$_GET['id']."'");
	$article = mysql_fetch_assoc($r);
	if($article && $article['owner'] == $_SESSION['idusers']){
		unlink("../data/".$article['file_name']);
		mysql_query("DELETE from articles WHERE idarticles='".$_GET['id']."'");
	}
	mysql_close($c);
}

?>
